<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>welcome首页</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit">
    <link href="/admin/static/welcome/frontend.min.css" rel="stylesheet">
    <script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="/admin/static/myfolder/js/common.js?ver={{config('constant.static_res_ver')}}"></script>
    <script type="text/javascript" src="/admin/lib/layer/3.1.1/layer.js"></script>
</head>

<body>
<main class="content">
    <section class="section suitable-section text-center pix-padding-bottom-40" id="suitable">
        <div class="container">
            <div class="row">
                @if($expirecount !== null)
                    <div class="col-sm-4 suitable-item">
                        <div class="pix-content text-center pix-padding-v-50 pix-margin-v-10 pix-padding-h-30">
                            <div class="pix-margin-bottom-20 suitable-img img-zoom">
                                @if($expirecount > 0)
                                    <img src="/admin/static/welcome/warn-red.png" alt="">
                                @else
                                    <img src="/admin/static/welcome/warn-blue.png" alt="">
                                @endif
                            </div>
                            <div class="suitable-title">
                                <strong @if($expirecount > 0) style="color: red;" @endif>到期预警({{$expirecount}})</strong>
                            </div>
                            <p class="suitable-intro" style="font-size: 12px;">
                                提前{{$settingdata['days']}}天通知，到期15天后不再提醒
                            </p>
                            <p>
                                <a href="/{{config('constant.name_admin')}}/contract/expire"
                                   class="btn blue-bg pix-white btn-round-lg wide">
                                    <b>进 入</b>
                                </a>
                            </p>
                        </div>
                    </div>
                @endif
                <div class="col-sm-4 suitable-item">
                    <div class="pix-content text-center pix-padding-v-50 pix-margin-v-10 pix-padding-h-30">
                        <div class="pix-margin-bottom-20 suitable-img img-zoom">
                            <img src="/admin/static/welcome/code.png" alt="">
                        </div>
                        <div class="suitable-title">
                            <strong>新建批次</strong>
                        </div>
                        <p class="suitable-intro">
                            创建一个空的批次
                        </p>
                        <p>
                            <a href="/{{config('constant.name_admin')}}/contract/addShow"
                               class="btn blue-bg pix-white btn-round-lg wide">
                                <b>进 入</b>
                            </a>
                        </p>
                    </div>
                </div>
                <div class="col-sm-4 suitable-item">
                    <div class="pix-content text-center pix-padding-v-50 pix-margin-v-10 pix-padding-h-20">
                        <div class="pix-margin-bottom-20 suitable-img img-zoom">
                            <img src="/admin/static/welcome/mobile.png" alt="">
                        </div>
                        <div class="suitable-title">
                            <strong>扫码受理和拍照</strong>
                        </div>
                        <p class="suitable-intro">
                            扫码受理和不合格/斗臂车拍照
                        </p>
                        <p>
                            @php $url = "/".config('constant.name_admin')."/appWeb/index";  @endphp
                            <a onclick="layer_show('扫码受理和拍照','{{$url}}','','',1)"
                               class="btn blue-bg pix-white btn-round-lg wide" target="_blank">
                                <b>进 入</b>
                            </a>
                        </p>
                    </div>
                </div>
                <div class="col-sm-4 suitable-item">
                    <div class="pix-content text-center pix-padding-v-50 pix-margin-v-10 pix-padding-h-20">
                        <div class="pix-margin-bottom-20 suitable-img img-zoom">
                            <img src="/admin/static/welcome/browser.png" alt="">
                        </div>
                        <div class="suitable-title">
                            <strong>结果录入</strong>
                        </div>
                        <p class="suitable-intro">
                            试验人员在这里录入检测结果
                        </p>
                        <p>
                            <a href="/{{config('constant.name_admin')}}/contract/indexResLuru"
                               class="btn blue-bg pix-white btn-round-lg wide">
                                <b>进 入</b>
                            </a>
                        </p>
                    </div>
                </div>
                <div class="col-sm-4 suitable-item">
                    <div class="pix-content text-center pix-padding-v-50 pix-margin-v-10 pix-padding-h-20">
                        <div class="pix-margin-bottom-20 suitable-img img-zoom">
                            <img src="/admin/static/welcome/laptop.png" alt="">
                        </div>
                        <div class="suitable-title">
                            <strong>个人信息</strong>
                        </div>
                        <p class="suitable-intro">
                            编辑查看个人信息
                        </p>
                        <p>
                            <a href="/{{config('constant.name_admin')}}/manager/editself"
                               class="btn blue-bg pix-white btn-round-lg wide">
                                <b>进 入</b>
                            </a>
                        </p>
                    </div>
                </div>
                @if(config('constant.bt_api_key'))
                <div class="col-sm-4 suitable-item">
                    <div class="pix-content text-center pix-padding-v-50 pix-margin-v-10 pix-padding-h-20">
                        <div class="pix-margin-bottom-20 suitable-img img-zoom">
                            <img src="/admin/static/welcome/backup.png" alt="">
                        </div>
                        <div class="suitable-title">
                            <strong>数据备份</strong>
                        </div>
                        <p class="suitable-intro">
                            数据库备份到服务器
                        </p>
                        <p>
                            <a class="btn blue-bg pix-white btn-round-lg wide" id="back_up">
                                <b>备 份</b>
                            </a>
                        </p>
                    </div>
                </div>
                @endif
                <div class="col-sm-4 suitable-item">
                    <div class="pix-content text-center pix-padding-v-50 pix-margin-v-10 pix-padding-h-20">
                        <div class="pix-margin-bottom-20 suitable-img img-zoom">
                            <img src="http://z.gqjjc03.vip/admin/static/welcome/zks.png" alt="">
                        </div>
                        <div class="suitable-title">
                            <strong>中控室</strong>
                        </div>
                        <p class="suitable-intro">
                            LED智慧实验室
                        </p>
                        <p>
                            <a onclick="check()" class="btn blue-bg pix-white btn-round-lg wide" target="_blank">
                                <b>进 入</b>
                            </a>
                        </p>
                    </div>
                </div>
                @if(!config('constant.is_lan'))
                <div class="col-sm-4 suitable-item">
                    <div class="pix-content text-center pix-padding-v-50 pix-margin-v-10 pix-padding-h-20" style="overflow: hidden;">
                        <div id="weather">
                            {!!$wea_str!!}
                        </div>
                        <div class="suitable-title">
                            <strong>天气信息</strong>
                        </div>
                        <div id="weather-refresh" class="btn blue-bg pix-white btn-round-lg wide">
                            <b>刷新</b>
                        </div>
                    </div>
                </div>
                @endif
            </div>
        </div>
    </section>
</main>
<script type="text/javascript" src="/admin/lib/jquery/jquery.cookie.min.js"></script>
<script type="text/javascript" src="/admin/lib/layer/3.1.1/layer.js"></script>
<script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
<script>
    var alert_pwd_msg = '{{$alert_pwd_msg}}',
        is_lan = "{{config('constant.is_lan')}}";
    $(function () {
        alert_pwd_msg != '' ? layer.confirm(alert_pwd_msg,{btn:['更新密码']},function () {
            layer_show('更新密码','/{{config('constant.name_admin')}}/manager/editpassself');
        }) : '';
        if ($('.container > .row > .suitable-item').length > 6) {
            $('.container > .row > .suitable-item').removeClass('col-sm-4').addClass('col-sm-3')
        }
        if(is_lan != 1){ //不是局域网
            // $('#weather-refresh').trigger('click');
        }
    })

    $('#weather-refresh').on('click',function () {
        try{
            ajax('get', 'getWeather', '', function(res){
                $('#weather').html(res);
            }, 0);
        }catch(err){
            console.log(err)
        }
        
    })

    $('#back_up').on('click',function (event) {
        ajax('get', "{{'/'.config('constant.name_admin').'/setting/backUp'}}", '', backUpBak, 0);
        function backUpBak(res) {
            layer.msg(res);
        }
    })

    function check() {
        if({{intval(config('constant.is_huibang'))}} == 0 && {{data_get($set_sys['setting'],'has_zks',0)}} == 0){
            layer.msg('您未购买中控室！');
            return false;
        }
        window.open("/{{config('constant.name_admin')}}/zks/index",'_blank');
    }

    function export2(){
        let obj = event.target;
        $(obj).attr('href',"export?"+$('#export_form').serialize());
    }
</script>
</body>
</html>
